package com.crm.service.impl.coursearrange;

import com.crm.dao.mapper.coursearrange.CourseArrangeMapper;
import com.crm.dao.mapper.customMapper.courseregist.CourseArrangeCustomMapper;
import com.crm.model.entity.coursearrange.CourseArrange;
import com.crm.model.entity.coursearrange.CourseArrangeExample;
import com.crm.model.qo.courseregist.CourseListQO;
import com.crm.model.vo.courseregist.CourseListVO;
import com.crm.service.coursearrange.CourseArrangeDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

/**
 * @Description: 排课Service
 * @Author lixq-f
 * @Date 2021/4/25
 * @Version V1.0
 **/
@Service
public class CourseArrangeDbServiceImpl implements CourseArrangeDbService {

    @Autowired
    private CourseArrangeMapper courseArrangeMapper;
    @Autowired
    private CourseArrangeCustomMapper arrangeCustomMapper;



    @Override
    public List<CourseArrange> selectListByAccountId(Short deleteStatus) {
        CourseArrangeExample example = new CourseArrangeExample();
        CourseArrangeExample.Criteria criteria = example.createCriteria();
        criteria.andDeleteStatusEqualTo(deleteStatus);
        return courseArrangeMapper.selectByExample(example);
    }


    @Override
    public List<CourseListVO> selectCourseList(CourseListQO courseListQO, String order) {
        return arrangeCustomMapper.selectCourseList(courseListQO,order);
    }

    @Override
    public CourseArrange getCourseById(String id) {
        return courseArrangeMapper.selectByPrimaryKey(id);
    }


    @Override
    public Boolean update(CourseArrange course) {
        return courseArrangeMapper.updateByPrimaryKeySelective(course) > 0;
    }


}
